//
//  StatusCode.m
//  KiklinkApp
//
//  Created by LF on 14-9-30.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "StatusCode.h"

const int SUCCESS = 1;

const int FAILURE = -1;

//1xx为不可恢复错误
const int FAILURE_NO_JSON_OBJECT = -101;
const int FAILURE_PARSE_ERROR = -102;

//2xx为正常错误
const int FAILURE_NETWORK_ERROR = -200;
const int FAILURE_RETURN_ERRER_CODE = -201;
const int FAILURE_EMPTY_RESULT = -202;
const int FAILURE_RELOGIN_FAILED = -203;
const int FAILURE_NEED_RELOGIN = -204;
const int FAILURE_NEED_LOGIN = -205;


@implementation StatusCode

+ (NSString*) getWordByCode:(int) statusCode
{
    switch (statusCode) {
        case SUCCESS:
            return @"成功";
        case FAILURE:
            return @"读取失败";
        case FAILURE_NO_JSON_OBJECT:
            return @"返回空结果";
        case FAILURE_PARSE_ERROR:
            return @"结果解析错误";
        case FAILURE_RETURN_ERRER_CODE:
            return @"服务器端返回错误码";
        case FAILURE_NETWORK_ERROR:
            return @"网络错误";
        case FAILURE_EMPTY_RESULT:
            return @"搜索结果为空";
        case FAILURE_RELOGIN_FAILED:
            return @"重新登陆失败";
        case FAILURE_NEED_RELOGIN:
            return @"需要重新登录";
        case FAILURE_NEED_LOGIN:
            return @"需要登录";
        default:
            return nil;
    }
}

@end
